package handler;

/* File: IntervalNode.java
 * Programmers: Brad Hietpas, Matt Wienkes & Gabrielle DuBois
 */

import java.io.*;
import java.util.ArrayList;

public class IntervalNode{
	private double a;
	private double b;
	private ArrayList<Double> tanPts = new ArrayList<Double>();

	/**
	 * IntervalNode
	 * @param ptA is a double of the "a" point of the interval
	 * @param ptB is a double of the "b" point of the interval
	 */
	public IntervalNode(double ptA, double ptB){
		a = ptA;
		b = ptB;
	}//constructor

	/**
	 * getA
	 * @return a double of the "a" point of the interval
	 */
	public double getA(){
		return a;
	}//getA()

	/**
	 * getB
	 * @return a double of the "b" point of the interval
	 */
	public double getB(){
		return b;
	}//getA()

	/**
	 * getTanPts
	 * @return an ArrayList<Double> containing all the tangent points for
	 * the this object's interval
	 */
	public ArrayList<Double> getTanPts(){
		return tanPts;
	}//getTanPts()

	/**
	 * addTanPt
	 * @param pt is a double of the point where the tangent line touched
	 * 			the curve
	 */
	public void addTanPt(double pt){
		tanPts.add( new Double(pt) );
	}//addTanPt(int)

	/**
	 * deleteTanPt
	 * @param pt is a double of the point where the tangent line touched
	 * 			the curve
	 */
	public void deleteTanPt(double pt){
		tanPts.remove( tanPts.indexOf(new Double(pt)) );
	}//deleteTanPt(int)

}//IntervalNode
